﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.Keyframe
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System;
using UnityEngine.Scripting;

#nullable disable
namespace UnityEngine
{
  /// <summary>
  ///   <para>A single keyframe that can be injected into an animation curve.</para>
  /// </summary>
  [RequiredByNativeCode]
  public struct Keyframe
  {
    private float m_Time;
    private float m_Value;
    private float m_InTangent;
    private float m_OutTangent;
    private int m_TangentMode;
    private int m_WeightedMode;
    private float m_InWeight;
    private float m_OutWeight;

    /// <summary>
    ///   <para>Create a keyframe.</para>
    /// </summary>
    /// <param name="time"></param>
    /// <param name="value"></param>
    public Keyframe(float time, float value)
    {
      this.m_Time = time;
      this.m_Value = value;
      this.m_InTangent = 0.0f;
      this.m_OutTangent = 0.0f;
      this.m_WeightedMode = 0;
      this.m_InWeight = 0.0f;
      this.m_OutWeight = 0.0f;
      this.m_TangentMode = 0;
    }

    /// <summary>
    ///   <para>Create a keyframe.</para>
    /// </summary>
    /// <param name="time"></param>
    /// <param name="value"></param>
    /// <param name="inTangent"></param>
    /// <param name="outTangent"></param>
    public Keyframe(float time, float value, float inTangent, float outTangent)
    {
      this.m_Time = time;
      this.m_Value = value;
      this.m_InTangent = inTangent;
      this.m_OutTangent = outTangent;
      this.m_WeightedMode = 0;
      this.m_InWeight = 0.0f;
      this.m_OutWeight = 0.0f;
      this.m_TangentMode = 0;
    }

    /// <summary>
    ///   <para>Create a keyframe.</para>
    /// </summary>
    /// <param name="time"></param>
    /// <param name="value"></param>
    /// <param name="inTangent"></param>
    /// <param name="outTangent"></param>
    /// <param name="inWeight"></param>
    /// <param name="outWeight"></param>
    public Keyframe(
      float time,
      float value,
      float inTangent,
      float outTangent,
      float inWeight,
      float outWeight)
    {
      this.m_Time = time;
      this.m_Value = value;
      this.m_InTangent = inTangent;
      this.m_OutTangent = outTangent;
      this.m_WeightedMode = 3;
      this.m_InWeight = inWeight;
      this.m_OutWeight = outWeight;
      this.m_TangentMode = 0;
    }

    /// <summary>
    ///   <para>The time of the keyframe.</para>
    /// </summary>
    public float time
    {
      get => this.m_Time;
      set => this.m_Time = value;
    }

    /// <summary>
    ///   <para>The value of the curve at keyframe.</para>
    /// </summary>
    public float value
    {
      get => this.m_Value;
      set => this.m_Value = value;
    }

    /// <summary>
    ///   <para>Sets the incoming tangent for this key. The incoming tangent affects the slope of the curve from the previous key to this key.</para>
    /// </summary>
    public float inTangent
    {
      get => this.m_InTangent;
      set => this.m_InTangent = value;
    }

    /// <summary>
    ///   <para>Sets the outgoing tangent for this key. The outgoing tangent affects the slope of the curve from this key to the next key.</para>
    /// </summary>
    public float outTangent
    {
      get => this.m_OutTangent;
      set => this.m_OutTangent = value;
    }

    /// <summary>
    ///   <para>Sets the incoming weight for this key. The incoming weight affects the slope of the curve from the previous key to this key.</para>
    /// </summary>
    public float inWeight
    {
      get => this.m_InWeight;
      set => this.m_InWeight = value;
    }

    /// <summary>
    ///   <para>Sets the outgoing weight for this key. The outgoing weight affects the slope of the curve from this key to the next key.</para>
    /// </summary>
    public float outWeight
    {
      get => this.m_OutWeight;
      set => this.m_OutWeight = value;
    }

    /// <summary>
    ///   <para>Weighted mode for the keyframe.</para>
    /// </summary>
    public WeightedMode weightedMode
    {
      get => (WeightedMode) this.m_WeightedMode;
      set => this.m_WeightedMode = (int) value;
    }

    /// <summary>
    ///   <para>TangentMode is deprecated.  Use AnimationUtility.SetKeyLeftTangentMode or AnimationUtility.SetKeyRightTangentMode instead.</para>
    /// </summary>
    [Obsolete("Use AnimationUtility.SetKeyLeftTangentMode, AnimationUtility.SetKeyRightTangentMode, AnimationUtility.GetKeyLeftTangentMode or AnimationUtility.GetKeyRightTangentMode instead.")]
    public int tangentMode
    {
      get => this.tangentModeInternal;
      set => this.tangentModeInternal = value;
    }

    internal int tangentModeInternal
    {
      get => this.m_TangentMode;
      set => this.m_TangentMode = value;
    }
  }
}
